package com.cxria.springboottest.web

import com.cxria.springboottest.entity.User
import com.cxria.springboottest.service.UserService
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.boot.autoconfigure.EnableAutoConfiguration
import org.springframework.stereotype.Controller
import org.springframework.ui.Model
import org.springframework.web.bind.annotation.GetMapping
import org.springframework.web.bind.annotation.PostMapping
import org.springframework.web.bind.annotation.RequestMapping
import org.springframework.web.bind.annotation.ResponseBody

@Controller
class HomeController {

    class Msg{
        String title
        String content
        String etraInfo
    }

    @Autowired
    private UserService userService;

    //@PreAuthorize("hasRole('admin')")
    @GetMapping('/')
    String index(Model model){
        def msg = new Msg(title: '标题', content: 'ssss', etraInfo: 'ssss')
        model.addAttribute('msg', msg)
        'index'
    }

}


